home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / admin / xinetd.2 / xinetd / xinetd.2.1.7-linux.4 / libs / src / timer / Makefile < prev    next >
Encoding:
Makefile  |  1993-07-25  |  3.8 KB  |  146 lines

  1. # (c) Copyright 1993 by Panagiotis Tsirigotis
  2. # All rights reserved.  The file named COPYRIGHT specifies the terms 
  3. # and conditions for redistribution.
  4.  
  5. #
  6. # $Id: Makefile,v 4.6 1993/06/20 20:05:28 panos Exp $
  7. #
  8. # Based on Library makefile template: *Revision: 1.15 *
  9. #
  10.  
  11. # Available entries:
  12. #         lib             --> creates the library
  13. #        install        --> installs the library (archive, man page(s), header(s))
  14. #        uninstall    --> uninstall the library
  15. #        clean            --> removes all .o and .a files
  16. #        spotless        --> clean + uninstall
  17. #         lint            --> lints a file (usage: make lint MODULE=foo.c)
  18. #        tags            --> creates a tags file (from the SOURCES and HEADERS)
  19. #        checkout     --> checkout all files
  20. #        dist            --> distribution support
  21. #
  22.  
  23. NAME                = timer
  24. VERSION            = 1.2.2
  25.  
  26. HEADERS            = timer.h impl.h ostimer.h timemacros.h defs.h
  27. SOURCES            = timer.c ostimer.c sysdep.c
  28. OBJECTS            = timer.o ostimer.o sysdep.o
  29.  
  30. MANFILES            = timer.3 timemacros.3
  31. INCLUDEFILES    = timer.h timemacros.h
  32.  
  33. # The following variables are used by the 'install' entry and
  34. # should be customized:
  35. #     LIBDIR:     where the library will be placed
  36. #     INCUDEDIR:  where the include files will be placed
  37. #     MANDIR:     where the man pages will be placed
  38. #
  39. LIBDIR            = $(HOME)/.links/libraries/$(ARCH)
  40. MANDIR            = $(HOME)/.links/manpages/man3
  41. INCLUDEDIR        = $(HOME)/.links/includes
  42.  
  43. #
  44. # Available flags:
  45. #
  46. #    DEBUG                :    enable some debugging code
  47. #    NO_TERMINATION    :    do not terminate if an error is discovered
  48. #    DEBUG_MSGS        :    print debugging messages
  49. #    NO_POSIX_SIGS    :    sigaction is not available (but sigvec is)
  50. #
  51. DEFS                =    -DDEBUG -DNO_POSIX_SIGS
  52. DEBUG                = -g            # -g or -O
  53. VERSION_DEF        = -DVERSION=\"TIMER\ Version\ $(VERSION)\"
  54.  
  55. CPP_DEFS            = -I$(INCLUDEDIR) $(VERSION_DEF) $(DEFS)
  56.  
  57. #
  58. # The following variables shouldn't need to be changed
  59. #
  60. LINT_FLAGS        = -hbux
  61. CPP_FLAGS        = $(CPP_DEFS) -I$(INCLUDEDIR)
  62. CC_FLAGS            = $(DEBUG)
  63. CFLAGS            = $(CPP_FLAGS) $(CC_FLAGS)
  64.  
  65. INSTALL            = install -c
  66. FMODE                = -m 640            # used by install
  67. RANLIB            = ranlib
  68.  
  69. PAGER                = less
  70.  
  71.  
  72. LIBNAME            = lib$(NAME).a
  73.  
  74. lib: $(LIBNAME)
  75.  
  76. libopt: clean
  77.     make DEBUG=-O lib
  78.     $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)/optimized
  79.  
  80. $(LIBNAME): $(OBJECTS)
  81.     ar r $@ $?
  82.     $(RANLIB) $@
  83.  
  84. lint:
  85.     lint $(CPP_FLAGS) $(LINT_FLAGS) $(MODULE) 2>&1 | $(PAGER)
  86.  
  87. install: $(LIBNAME)
  88.     @if test "$(LIBDIR)" -a "$(INCLUDEDIR)" -a "$(MANDIR)" ;\
  89.     then \
  90.         $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR) ;\
  91.         echo "Installed $(LIBNAME) to $(LIBDIR)" ;\
  92.         for i in $(INCLUDEFILES); do $(INSTALL) $(FMODE) $$i $(INCLUDEDIR) ; done ;\
  93.         echo Installed $(INCLUDEFILES) to $(INCLUDEDIR) ;\
  94.         for i in $(MANFILES) ; do $(INSTALL) $(FMODE) $$i $(MANDIR) ; done ;\
  95.         echo Installed $(MANFILES) to $(MANDIR) ;\
  96.     else \
  97.         echo "You forgot to set one of the following variables: LIBDIR,INCLUDEDIR,MANDIR" ;\
  98.     fi
  99.  
  100. uninstall:
  101.     a=`pwd` ; cd $(INCLUDEDIR) ;\
  102.     if test $$a != `pwd` ; then rm -f $(INCLUDEFILES) ; fi
  103.     a=`pwd` ; cd $(LIBDIR) ;\
  104.     if test $$a != `pwd` ; then rm -f $(LIBNAME) ; fi
  105.     a=`pwd` ; cd $(MANDIR) ;\
  106.     if test $$a != `pwd` ; then rm -f $(MANFILES) ; fi
  107.  
  108. clean:
  109.     rm -f $(OBJECTS) $(LIBNAME) core
  110.  
  111. spotless: clean uninstall
  112.  
  113. tags: $(SOURCES) $(HEADERS)
  114.     ctags -w $(SOURCES) $(HEADERS)
  115.  
  116. checkout:
  117.     co $(SOURCES) $(HEADERS) $(MANFILES)
  118.  
  119. #
  120. # Distribution section
  121. # This section contains the 2 targets for distribution support: dist, dirs
  122. # "dist" checks out all files to be distributed
  123. # "dirs" prints a list of directories to be included in the distribution.
  124. # These directories should have a Makefile with a "dist" target
  125. #
  126. DISTRIBUTION_FILES    = $(SOURCES) $(HEADERS) $(MANFILES) COPYRIGHT
  127. DIRS                        =
  128.  
  129. dist:
  130.     -co -q $(DISTRIBUTION_FILES)
  131.  
  132. dirs:
  133.     @echo $(DIRS)
  134.  
  135. #
  136. # PUT HERE THE RULES TO MAKE THE OBJECT FILES
  137. #
  138. timer.o: timemacros.h impl.h timer.h defs.h
  139. ostimer.o: ostimer.h timemacros.h impl.h timer.h defs.h
  140. sysdep.o: ostimer.h timemacros.h impl.h timer.h defs.h
  141.  
  142. ttest: ttest.c $(LIBNAME)
  143.     cc $(DEBUG) -o $@ ttest.c $(LIBNAME) -L$(LIBDIR) -lpq
  144.  
  145.